//第十二章，不使用全局变量重写12.4的程序
#include <stdio.h>
//function
int critic(void);
//其中units可以设置为全局变量，可选用重复声明来增加代码的易读性
int main(void)
{
	int units;
	printf("how many pounds to a firkin of butter?\n");
	scanf_s("%d", &units, 2);
	while (units != 56)
		units=critic();
	printf("you must have looked it up!\n");
	return 0;
}

int critic(void)
{
	int u;
	printf("no luck,my friend.try again.\n");
	scanf_s("%d", &u, 2);
	return u;
}